﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.Mobile.ObjectBuilder;

namespace ColdBootObjectBuilder
{
	/// <summary>
	/// Never allows location of anything, hence, 
	/// objects will always be created anew.
	/// </summary>
	public class NullLocator : IReadWriteLocator
	{
		public void Add(object key, object value)
		{
		}

		public bool Remove(object key)
		{
			return false;
		}

		public bool Contains(object key, SearchMode options)
		{
			return false;
		}

		public bool Contains(object key)
		{
			return false;
		}

		public int Count
		{
			get { return 0; }
		}

		public IReadableLocator FindBy(SearchMode options, Predicate<KeyValuePair<object, object>> predicate)
		{
			return null;
		}

		public IReadableLocator FindBy(Predicate<KeyValuePair<object, object>> predicate)
		{
			return null;
		}

		public object Get(object key, SearchMode options)
		{
			return null;
		}

		public object Get(object key)
		{
			return null;
		}

		public TItem Get<TItem>(object key, SearchMode options)
		{
			return default(TItem);
		}

		public TItem Get<TItem>(object key)
		{
			return default(TItem);
		}

		public TItem Get<TItem>()
		{
			return default(TItem);
		}

		public IReadableLocator ParentLocator
		{
			get { return null; }
		}

		public bool ReadOnly
		{
			get { return false; }
		}

		public IEnumerator<KeyValuePair<object, object>> GetEnumerator()
		{
			return new Dictionary<object, object>().GetEnumerator();
		}

		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			return GetEnumerator();
		}
	}
}
